package com.teddy.DTXMB.Service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.teddy.DTXMB.Mapper.ShoppingCartMapper;
import com.teddy.DTXMB.Model.ShoppingCart;
import com.teddy.DTXMB.Service.ShoppingCartService;

@Service
public class ShoppingCartServiceImpl implements ShoppingCartService{
	
	@Autowired
	private ShoppingCartMapper shoppingCartMapper;
	
	@Override
	public List<ShoppingCart> getShoppingCartByCustomID(int id) {	
		return shoppingCartMapper.selectShoppingCartByCustomID(id);
	}

	@Override
	public boolean addToShoppingCart(ShoppingCart sc) {
		try{
			shoppingCartMapper.addToShoppingCart(sc);
			return true;
		}
		catch(Exception e)
		{
			e.printStackTrace();
			return false;
		}
	}
}
